/**************************************************************************
 //* W Corp. 
 //* W Profile Services                                             
 //* Package:  by.doubleyou.core.config
 //* (C) Copyright W Corp.  2007
 /**************************************************************************
 *
 * Copyright (c) 2007, W Corporation
 * All rights reserved.
 * 
 * Version: 1.0
 * Date:  3 Dec, 2007, Author: Alexander J. Perez Tchernov
 * 
 * MODIFICATION HISTORY:
 * Defect/Feature  	Description
 * ---
 */
package by.doubleyou.core.config;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 * Common congifuration class
 * 
 * @author Alexander J. Perez Tchernov
 * 
 */
public class AppConfig {
	private Context context;

	
	/**
	 * get context
	 * @return
	 */
	public Context getContext() {
		return context;

	}

	public AppConfig(String APPCONFIG_JNDINAME) throws NamingException {
		Context c = (Context) new InitialContext().lookup(APPCONFIG_JNDINAME);

		if (c == null)
			throw new NamingException("no object found with jndi name `"
					+ APPCONFIG_JNDINAME + "'");
		context = c;
	}

}
